home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The 640 MEG Shareware Studio 5
/
The 640 Meg Shareware Studio CD-ROM Volume V (Data Express)(1994).ISO
/
amiga
/
d_atmb23.lha
/
ATM_TIME
/
ATM_interest
< prev
next >
Wrap
Text File
|
1994-02-19
|
4KB
|
91 lines
/**************************************************************************\
ATM TIME Bank Interest Calculator (Daily & Monthly Maint Module)
$VER: ATM TIME Bank Interest Calculator, v2.3 (20-Feb-94) by Dotoran!
\**************************************************************************/
options results ; signal on SYNTAX ; signal on ERROR ; signal on IOERR
tr=transmit ; se=sendstring ; gc=getchar ; qu=query
accounts='pfiles:atm/files/accounts' ; date=date('e')
config='pfiles:atm/files/atm_config' ; sflag=0
call open(f1,accounts,'r')
t=readln(f1) ; totacts=word(t,1)
if totacts=0 then do ; close(f1) ; exit ; end
do i=1 to 3 ; j=readln(f1) ; end i
do i=1 to totacts ; atm.i=readln(f1)
parse var atm.i j tf.i pin.i min.i j j j han.i
end i
call close(f1)
tr 'f1z1cfCalculating Daily ATM Bank Interest for:z0c9 'totacts' caTotal Accounts.n1'
call open(f1,config,'r')
do i=1 to 3 ; con.i=readln(f1) ; end i
call close(f1)
parse var con.1 junk junk junk max_min junk
parse var con.3 min_base min_good min_bad junk
do i=1 to totacts ; ifile='pfiles:atm/interest/pin'||pin.i||'_INTEREST'
se 'cbCLIENT:ca'han.i'cf: c9'
call open(f1,ifile,'r')
min_total=readln(f1) ; idate=readln(f1)
call close(f1)
if idate=date then do ; tr 'Already Calculated For Today!'
iterate i ; end
if tf.i=1 & min.i>=min_base then min_total=min_total+min_good
if tf.i=1 & min.i<min_base then min_total=min_total-min_bad
itotal=min_total ; if substr(date,4,2)~=substr(idate,4,2) then mf.i=1
call open(f1,ifile,'w')
call writeln(f1,itotal) ; call writeln(f1,date)
call close(f1)
tr min_total' cdMinutescf. (ce'date'cf)'
end i
tr 'n1z1cfUpdating Monthly Client Records for:z0c9 'totacts' caTotal Accountsn1'
do i=1 to totacts
ifile='pfiles:atm/interest/pin'||pin.i||'_INTEREST'
tfile='pfiles:atm/time/pin'||pin.i||'_TIME'
se 'cbCLIENT:ca'han.i'cf:c9 '
call open(f1,ifile,'r')
min_total=readln(f1) ; idate=readln(f1)
call close(f1)
if mf.i~=1 then do
tr 'Already Updated this Record!' ; iterate i ; end
itotal='0' ; min_total=min_total%1
if min_total+min.i>max_min then min_total=max_min-min.i
min.i=min.i+min_total ; if min.i<1 & tf.i=1 then min.i=1
call open(f1,ifile,'w')
call writeln(f1,itotal) ; call writeln(f1,date)
call close(f1) ; sflag=1
atm.i=delword(atm.i,4,1)
atm.i=insert(' '||left(min.i,3),atm.i,wordindex(atm.i,4)-2)
ts=sign(min_total) ; if ts<1 then ts=2
tr abs(min_total)' cdMinutes 'word('cbAdded ceDeducted',ts)'cf.'
if tf.i=1 then do ; call open(f1,tfile,'a')
if ts=1 then call writeln(f1,date||' INTEREST DUES OF '||abs(min_total)||' MINUTES.')
if ts=2 then call writeln(f1,date||' FINANCE CHARGE OF '||abs(min_total)||' MINUTES.')
call close(f1) ; end
end i
if sflag=0 then exit
call open(f1,accounts,'w')
t=left(totacts,4)||'Total Accounts' ; call writeln(f1,t)
t.1='' ; t.2='ID# T PIN# MIN-Day-Call LastUsed Handle Of Client'
t.3='-------------------------------------------------'
do i=1 to 3 ; call writeln(f1,t.i) ; end i
do i=1 to totacts
call writeln(f1,atm.i)
end i
call close(f1)
exit
SYNTAX: ; ERROR: ; IOERR: ; gu 1311992 ; a=result ; gu 1311960 ; b=result
er='z4cf'a||b'z0 c9ERRORce: cb'rc' cf(ce'errortext(rc)'cf) c6'
er=er||'in line ca'sigl'c6.' ; tr 'n1'er ; logentry er ; bufferflush
/** END *******************************************************************\
\****************************************** FRONTIERS BBS (716)/823-9892 **/